package mobi.greenplate.theweb.converter;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import java.util.Date;

import mobi.greenplate.theweb.domain.Location;
//for : enum types (and many-to-one)



@XmlRootElement(name = "location")
public class LocationConverter {
    private final Location entity;

    public LocationConverter() {
        this.entity = new Location();
    }

    public LocationConverter(Location entity) {
        this.entity = entity;
    }

    @XmlElement
    public Long getId() {
        return entity.getId();
    }

    public void setId(Long id) {
        entity.setId(id);
    }
    
    @XmlTransient
    public Location getEntity(){
        return entity;
    }    
    
    @XmlElement
    public String getLocationName() {
        return entity.getLocationName();
    }
    
    public void setLocationName(String locationName) {
        entity.setLocationName(locationName);
    }

    @XmlElement
    public AddressConverter getAddress() {
        return new AddressConverter(entity.getAddress());
    }
    
    public void setAddress(AddressConverter addressConverter) {
         entity.setAddress(addressConverter.getEntity());
    }

    @XmlElement
    public UserConverter getOwner() {
        return new UserConverter(entity.getOwner());
    }

    public void setOwner(UserConverter userConverter) {
        entity.setOwner(userConverter.getEntity());
    }
   
}

